package lime.model;

import java.util.List;

import lime.service.RepositoryService;
import lime.service.SpringApplicationContext;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.model.IWorkbenchAdapter;

public class UserRoot implements IWorkbenchAdapter {

	private RepositoryService repositoryService;
	
	public UserRoot() {
		repositoryService = (RepositoryService) SpringApplicationContext.getBean("repositoryService");
	}
	
	// ========================================
	// IWorkbenchAdapter
	// ========================================
	
	@Override
	public Object[] getChildren(Object o) {
		List<User> users = repositoryService.getUsers();
		return users.toArray();
	}

	@Override
	public ImageDescriptor getImageDescriptor(Object object) {
		return null;
	}

	@Override
	public String getLabel(Object o) {
		return null;
	}

	@Override
	public Object getParent(Object o) {
		return null;
	}
}
